<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    .active {
      color: red;
    }
  </style>
</head>
<body>
<!--
  需求：鼠标滑过哪一项，该项的文字变为红色，其他项为黑色
-->
<div id="app">
  <ul>
    <li :class="{active: select==index}" v-for="(item, index) in movies" v-on:mouseover="getClasses(index)">{{item}}</li>
  </ul>
</div>

<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      select: -1,
      movies: ['大话西游', '英雄本色', '三国演义', '水浒传']
    },
    methods: {
      getClasses: function(index) {
        this.select = index;
      }
    }
  });
</script>
</body>
</html>